"""
演示类和对象的关系，即面对对象的编程套路（思想）
"""

class Clock:
    id = None # 序列化
    price = None # 价格

    def ring(self):
        import winsound
        winsound.Beep(2000,5000)

# 构建2个闹钟对象并让其工作
clock1 = Clock()
clock1.id = "0020"
clock1.price = 100
print(f"闹钟ID：{clock1.id}, 价格：{clock1.price}")
clock1.ring()

clock2 = Clock()
clock2.id = "0030"
clock2.price = 1000
print(f"闹钟ID：{clock2.id}, 价格：{clock2.price}")
clock2.ring()